package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 电子栅栏表
 * @TableName electronic_fence
 */
@TableName(value ="electronic_fence")
@Data
public class ElectronicFence implements Serializable {
    /**
     * 栅栏ID
     */
    @TableId(type = IdType.AUTO)
    private Long fenceId;

    /**
     * 栅栏名称
     */
    private String fenceName;

    /**
     * 栅栏类型：1-多边形，2-圆形
     */
    private Integer fenceType;

    /**
     * 栅栏数据(JSON格式)
     */
    private String fenceData;

    /**
     * 中心经度
     */
    private BigDecimal centerLongitude;

    /**
     * 中心纬度
     */
    private BigDecimal centerLatitude;

    /**
     * 半径(米)
     */
    private BigDecimal radius;

    /**
     * 状态：1-启用，2-禁用
     */
    private Integer status;

    /**
     * 创建人ID
     */
    private Long createUserId;

    /**
     * 创建时间
     */
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ElectronicFence other = (ElectronicFence) that;
        return (this.getFenceId() == null ? other.getFenceId() == null : this.getFenceId().equals(other.getFenceId()))
            && (this.getFenceName() == null ? other.getFenceName() == null : this.getFenceName().equals(other.getFenceName()))
            && (this.getFenceType() == null ? other.getFenceType() == null : this.getFenceType().equals(other.getFenceType()))
            && (this.getFenceData() == null ? other.getFenceData() == null : this.getFenceData().equals(other.getFenceData()))
            && (this.getCenterLongitude() == null ? other.getCenterLongitude() == null : this.getCenterLongitude().equals(other.getCenterLongitude()))
            && (this.getCenterLatitude() == null ? other.getCenterLatitude() == null : this.getCenterLatitude().equals(other.getCenterLatitude()))
            && (this.getRadius() == null ? other.getRadius() == null : this.getRadius().equals(other.getRadius()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateUserId() == null ? other.getCreateUserId() == null : this.getCreateUserId().equals(other.getCreateUserId()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getFenceId() == null) ? 0 : getFenceId().hashCode());
        result = prime * result + ((getFenceName() == null) ? 0 : getFenceName().hashCode());
        result = prime * result + ((getFenceType() == null) ? 0 : getFenceType().hashCode());
        result = prime * result + ((getFenceData() == null) ? 0 : getFenceData().hashCode());
        result = prime * result + ((getCenterLongitude() == null) ? 0 : getCenterLongitude().hashCode());
        result = prime * result + ((getCenterLatitude() == null) ? 0 : getCenterLatitude().hashCode());
        result = prime * result + ((getRadius() == null) ? 0 : getRadius().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateUserId() == null) ? 0 : getCreateUserId().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", fenceId=").append(fenceId);
        sb.append(", fenceName=").append(fenceName);
        sb.append(", fenceType=").append(fenceType);
        sb.append(", fenceData=").append(fenceData);
        sb.append(", centerLongitude=").append(centerLongitude);
        sb.append(", centerLatitude=").append(centerLatitude);
        sb.append(", radius=").append(radius);
        sb.append(", status=").append(status);
        sb.append(", createUserId=").append(createUserId);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}